import type { ProfileInfo, LoginParams, TokenInfo } from '@/types/user.d.ts'
import { http } from '@/utils/http'

export const loginApi = (data: LoginParams) => {
  return http.post<TokenInfo>('/v1_0/authorizations', data)
}

/**
 * 获取用户数据
 */
export const getProfileApi = () => {
  return http.get<ProfileInfo>('/v1_0/user/profile')
}
